package com.google.code.mircle.core.views;

import java.io.File;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;

import com.google.code.mircle.core.Model;
import com.google.code.mircle.core.Plugin;
import com.google.code.mircle.core.Root;
import com.google.code.mircle.core.View;

public class ViewsPlugin implements Plugin, Root {

    public ViewsPlugin() {
    }

    public void close() {

    }

    public String getName() {
        return "Views";
    }

    public Model[] getModels() {
        return new Model[] { new PlaylistModel("Star Trek Next Generation"),
                new PlaylistModel("Star Wars Original trilogy"), new PlaylistModel("Prodigy my favorite songs") };
    }
    
    public JPopupMenu contextMenu(Model m) {
        JPopupMenu popup = new JPopupMenu();
        popup.add(new JMenuItem("123"));
        return popup;
    }

    public View createView(Model m) {
        if (m instanceof PlaylistModel)
            return new PlaylistView((PlaylistModel) m);
        return null;
    }

    @Override
    public void save(File path) {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void load(File path) {
        // TODO Auto-generated method stub
        
    }
}
